package com.scetoop.bank;

import javax.swing.text.html.HTMLDocument;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Bank {
    //private Customer[] customers;
    //private int numberOfCustomers;
    private List<Customer> customers;
    public Bank(){
        customers = new ArrayList<>();
    }

    private static Bank bank = new Bank();
    public static Bank getBank(){
        return bank;
    }

    public static Bank getInstance(){
        return bank;
    }
    public void addCustomer(String f, String l){
//        this.firstName = f;
//        this.lastName = l;
//        Customer customer = customers.
        Customer customer = new Customer(f,l);
        //if(numberOfCustomers < customers.length){
         //   customers[numberOfCustomers] = customer;
           // numberOfCustomers++;

        customers.add(new Customer(f, l));
        }


    public int getNumOfCustomers(){
        return customers.size();
    }
    public Customer getCustomer(int index){
           // return customers[index];
        return customers.get(index);
        }
        public Iterator<Customer> getCustomers(){
        return customers.iterator();
        }
    }
